﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using CYTS.Aoyou.Framework.Config;

namespace CYTS.Aoyou.Framework.Database
{
    /// <summary>
    /// 数据库提供者配置
    /// </summary>
    public class DBProviderConfig : ConfigUnit
    {
        /// <summary>
        /// 数据库提供者配置列表
        /// </summary>
        public List<DBProvider> DBProviders { get; set; }
    }

    /// <summary>
    /// 数据库提供者配置
    /// </summary>
    public class DBProvider
    {
        /// <summary>
        /// 数据库类别
        /// </summary>
        [XmlAttribute(AttributeName = "category")]
        public DatabaseCategory Category { get; set; }

        /// <summary>
        /// 连接字符串配置列表
        /// </summary>
        public List<DBConnection> DBConnections { get; set; }
    }

    /// <summary>
    /// 数据库连接串配置
    /// </summary>
    public class DBConnection
    {
        /// <summary>
        ///  数据库连接串名称
        /// </summary>
        [XmlAttribute(AttributeName = "name")]
        public string Name { get; set; }

        /// <summary>
        /// 数据库连接串
        /// </summary>
        [XmlAttribute(AttributeName = "connection")]
        public string Connection { get; set; }
    }
}
